<?php 

require 'i_global.php';
require 'func_reg_auth.php';

if($_REQUEST['login'] != NULL) {
	if(user_login($_REQUEST['email'], $_REQUEST['password'])) { // success
		header("Location: ${$URL_ROOT}user_dashboard.php");	
	} else {
		$ERROR_MESG = "Failed to log in.";
	}
} 
require_once 'p_header.php';
?>
<div class="span16"><div class="span13">

        <h1>Welcome</h1>
        
        <p>First time here? Please <a href='reg_form.php'>register</a> first.</p>
 

 <form>
        <fieldset>
          <!-- legend>Example form legend</legend-->
          <div class="clearfix">
            <label for="email">Email</label>
            <div class="input">
              <input class="xlarge" id="email" name="email" size="30" type="text" />
            </div>
          </div><!-- /clearfix -->
          <div class="clearfix">
            <label for="password">Password</label>
            <div class="input">
              <input class="xlarge" id="password" name="password" size="30" type="password" />
            </div>
          </div><!-- /clearfix -->

       
          <div class="actions">
            <input type="submit" class="btn primary" name="login" value="Login">&nbsp;<button type="reset" class="btn">Cancel</button>
          </div>
        </fieldset>
      </form>

<?php 
if($ERROR_MESG != NULL) {
	echo "<p>$ERROR_MESG</p>";
}
?>



</div></div><!-- end div span9 -->
<?php 
// require_once 'p_rightpanel.php';
require_once 'p_footer.php';

?>



